let arr = new Array(2);
console.log(arr.length);

let arr = Array.of(2);
console.log(arr); // [2]

// fill() 给数组填充元素
let arr =new Array(3);
arr.fill(5);
console.log(arr);

// find()找到匹配的值  findIndex(item=>{}) 找到该索引
let arr2 = [1,3,5,7,9];
// find 找到元素满足条件则返回该元素   否则返回underfined
let res = arr2.findIndex(function(item,index){
    return item == 7;
})
console.log(res);

// copyWithin
// es7 includes
let arr3 = [1,3,5,7,9];
console.log(arr3.includes(9));

// for of
let arr3 = [1,3,5,7,9];
for(let num of arr3){
    console.log(num); //值
}

for(let k of Object.keys({a:1,b:2})){
    console.log(k)
}